package cn.stylefeng.guns.modular.system.mapper;

import cn.stylefeng.guns.modular.system.entity.Rent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 车辆表 Mapper 接口
 * </p>
 */
public interface RentMapper extends BaseMapper<Rent> {

    boolean insertRecord(@Param("userId") Long userId,
                         @Param("carId") Long carId);
    void deleteRecord(@Param("userId") Long userId);

    Long selectRecord(@Param("userId") Long userId);

    List<Map<String, Object>> selectRents(@Param("userId") Long userId);

    List<Map<String, Object>> selectRentsByCar(@Param("carId") Long carId);

    Rent selectRent(@Param("userId") Long userId);

    boolean updateByUserId(@Param("rent")Rent rent);
}
